#pragma once

#include "CLComLibrarys_global.h"
//CLCOMLIBRARYS_EXPORT
#include "CLComString.h"
#include <mutex>

enum COMM_OBJECT_TYPE
{
	COMM_OBJECT_TYPE_OBJECT = 0,
    //COMM_OBJECT_TYPE_CHAIN,
};
enum ELOCALOBJECT_RETURN_VALUE
{
	ELOCALOBJECT_RETURN_VALUE_FALSE = 0,
	ELOCALOBJECT_RETURN_VALUE_OK,
};

class CLCOMLIBRARYS_EXPORT CLocalObject
{
public:
    CLocalObject(CLComString id = "");
	virtual ~CLocalObject();
public:
	COMM_OBJECT_TYPE GetType();

    CLComString GetID();
    CLComString GetID() const;
    virtual CLComString CreatePath(CLComString pathName, CLComString cateName);
	virtual int Init();

public:
	void SetType(COMM_OBJECT_TYPE type);
	void EnterSection();
	void LeaveSection();
	bool BWantExit();

protected:
    void SetID(CLComString id);
    void SetName(CLComString name);
	void SetWantExit();

private:
	void GenerateGlobalID();

protected:
    mutex               m_lockSetion;
private:
    COMM_OBJECT_TYPE    m_eType;
    CLComString         m_ID;
    bool                m_bRdyExit;

    CLComString         m_name;
};

